class Car:
    def __init__(self,name,mark='bmw',color='red',price=10,speed=200):
        self.name = name
        self.mark = mark
        self.color = color
        self.price = price
        self.speed = speed
    def add_car(self):
        d = {}
        d[self.name]='mark'+':'+self.mark+' '+'color:'+self.color+' '+'price:'+str(self.price)+' '+'speed:'+str(self.speed)
        with open('carfile','a+') as f:
            f.write(str(d))
    def view_all_car(self):
        with open('carfile') as f:
            f.read()
     
c = Car('bw')
b = Car('bwq')
b.add_car()
c.add_car()
c.view_all_car()


# 这里车辆管理的方式，是不是要放到别的类里面呢
